package com.autotest0211;

import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

/**
 * @Author YuanYuan
 * @Date 2023/2/11
 * @Time 16:59
 */
public class NoHeadTestDemo {
    public void paramsControll() {
        //百度搜索迪丽热巴
        //先创建选项对象,然后再设置浏览器参数
        ChromeOptions options = new ChromeOptions();
        options.addArguments("-headless");
        ChromeDriver driver = new ChromeDriver(options);
        driver.get("https://www.baidu.com");
        driver.findElement(By.cssSelector("#kw")).sendKeys("朱一龙");
        driver.findElement(By.cssSelector("#su")).click();
        driver.quit();
    }
}
